import layoutHeaderAside from "@/layout/header-aside";

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require("@/libs/util.import." + process.env.NODE_ENV);

const meta = { auth: true, cache: true };

export default {
  path: "/:menuCode/:menuId/main",
  name: "main-data",
  meta: { ...meta, level: 0 },
  component: layoutHeaderAside,
  children: [
    {
      path: "goods",
      name: "main-goods",
      meta: { ...meta, title: "物资管理" }
    },
    {
      path: "goods/majorClass",
      name: "main-goods-majorClass",
      component: _import("main/goods/majorClass.vue"),
      meta: { ...meta, title: "大类设置" }
    },
    {
      path: "goods/place",
      name: "main-goods-place",
      component: _import("main/goods/place.vue"),
      meta: { ...meta, title: "厂家设置" }
    },
    {
      path: "goods/productName",
      name: "main-goods-productName",
      component: _import("main/goods/productName.vue"),
      meta: { ...meta, title: "品名设置" }
    },
    {
      path: "goods/productPicture",
      name: "main-product-picture",
      component: _import("main/goods/productPicture.vue"),
      meta: { ...meta, title: "品名图片设置" }
    },
    {
      path: "goods/specifications",
      name: "main-goods-specifications",
      component: _import("main/goods/specifications.vue"),
      meta: { ...meta, title: "规格设置" }
    },
    {
      path: "goods/texture",
      name: "main-goods-texture",
      component: _import("main/goods/texture.vue"),
      meta: { ...meta, title: "材质设置" }
    },
    {
      path: "goods/goods",
      name: "main-goods-index",
      component: _import("main/goods/index.vue"),
      meta: { ...meta, title: "物资设置" }
    },
    {
      path: "storehouse",
      name: "main-storehouse",
      meta: { ...meta, title: "仓库管理" }
    },
    {
      path: "storehouse/storeHouse",
      name: "main-storehouse-index",
      component: _import("main/storehouse/index.vue"),
      meta: { ...meta, title: "仓库设置" }
    },
    {
      path: "storehouse/location",
      name: "main-storehouse-location",
      component: _import("main/storehouse/location.vue"),
      meta: { ...meta, title: "库位设置" }
    },
    {
      path: "storehouse/goodsShelves",
      name: "main-storehouse-goodsShelves",
      component: _import("main/storehouse/goodsShelves.vue"),
      meta: { ...meta, title: "材质设置" }
    },
    {
      path: "storehouse/jurisdiction",
      name: "main-storehouse-jurisdiction",
      component: _import("main/storehouse/jurisdiction.vue"),
      meta: { ...meta, title: "仓库权限设置" }
    },
    {
      path: "storehouse/third",
      name: "main-storehouse-third",
      component: _import("main/storehouse/third.vue"),
      meta: { ...meta, title: "第三方仓库数据对照表" }
    },
    {
      path: "merchants",
      name: "main-merchants",
      meta: { ...meta, title: "客商管理" }
    },
    {
      name: "main-merchants-organization",
      component: _import("main/merchants/unitManager.vue"),
      meta: { ...meta, title: "往来单位管理" },
      path: "merchants/unitManager"
    },
    {
      component: _import("main/merchants/unitManagerAdd.vue"),
      meta: { ...meta, title: "往来单位管理-新增" },
      name: "main-merchants-department-add",
      path: "merchants/unitManager/add"
    },
    {
      component: _import("main/merchants/unitManagerModify.vue"),
      meta: { ...meta, title: "往来单位管理-修改" },
      name: "main-merchants-departmeng-modify",
      path: "merchants/unitManager/modify/:id"
    },
    {
      component: _import("main/merchants/unitManagerDetail.vue"),
      meta: { ...meta, title: "往来单位管理-详情" },
      name: "main-merchants-departmeng-Detail",
      path: "merchants/unitManager/Detail/:id"
    },
    {
      component: _import("main/merchants/project.vue"),
      meta: { ...meta, title: "项目管理" },
      name: "main-merchants-project",
      path: "merchants/project"
    },
    {
      component: _import("main/merchants/projectType.vue"),
      meta: { ...meta, title: "项目类型设置" },
      name: "main-merchants-project-type",
      path: "merchants/projectType"
    },
    {
      component: _import("main/merchants/contacts.vue"),
      meta: { ...meta, title: "联系人管理" },
      name: "main-merchants-contacts",
      path: "merchants/contacts"
    },
    {
      component: _import("main/merchants/contactsModify.vue"),
      meta: { ...meta, title: "联系人管理-修改" },
      name: "main-merchants-contacts-modify",
      path: "merchants/contacts/modify/:id"
    },
    {
      component: _import("main/merchants/contactsDetail.vue"),
      meta: { ...meta, title: "联系人管理-详情" },
      name: "main-merchants-contacts-detail",
      path: "merchants/contacts/detail/:id"
    },
    {
      component: _import("main/merchants/purchaseBlacklist.vue"),
      meta: { ...meta, title: "采销黑名单" },
      name: "main-merchants-purchaseBlacklist",
      path: "merchants/purchaseBlacklist"
    },
    {
      component: _import("main/merchants/purchaseBlacklistAdd.vue"),
      meta: { ...meta, title: "采销黑名单-新增" },
      name: "main-merchants-purchaseBlacklist-add",
      path: "merchants/purchaseBlacklistAdd"
    },
    {
      component: _import("main/merchants/purchaseBlacklistAdd.vue"),
      meta: { ...meta, title: "采销黑名单-修改" },
      name: "main-merchants-purchaseBlacklist-modify",
      path: "merchants/purchaseBlacklistModify"
    },
    {
      component: _import("main/merchants/main.vue"),
      meta: { ...meta, title: "往来单位权限设置-主数据" },
      name: "main-merchants-main",
      path: "merchants/main"
    },
    {
      component: _import("main/merchants/subsidiary.vue"),
      meta: { ...meta, title: "往来单位权限设置-子公司" },
      name: "main-merchants-subsidiary",
      path: "merchants/subsidiary"
    },
    {
      component: _import("main/merchants/account.vue"),
      meta: { ...meta, title: "账号设置" },
      name: "main-merchants-account",
      path: "merchants/account"
    },
    {
      component: _import('main/merchants/accountDetail.vue'),
      meta: { ...meta, title: '帐号设置-详情'},
      name: 'main-merchants-account-detail',
      path: 'merchants/account/detail/:id'
    }
  ]
};
